﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Rename
{
    public static class ObjExtension
    {
        public static void Output(this object obj, bool bReturn = true)
        {
            if (obj == null)
                return;
            if (bReturn)
                Console.WriteLine(obj);
            else
                Console.Write(obj);
        }

        public static bool IsNullOrEmpty(this string str)
        {
            return string.IsNullOrEmpty(str) || str.Trim().Length == 0;
        }

        public static bool IsEquals(this string str, params string[] targets)
        {
            if (targets == null || targets.Length == 0)
            {
                return false;
            }
            foreach (var tar in targets)
            {
                if (str.Equals(tar, StringComparison.OrdinalIgnoreCase))
                {
                    return true;
                }
            }
            return false;
        }
    }
}
